package com.ruoyi.project.lesson.media.domain;

import com.ruoyi.common.utils.DurationUtil;
import com.ruoyi.common.utils.SizeUtil;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;

import java.util.Date;

/**
 * 音视频管理对象 lesson_media
 *
 * @author shixiangwen
 * @date 2020-12-11
 */
public class LessonMedia extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    private Long id;

    /**
     * 媒体ID
     */
    @Excel(name = "媒体ID")
    private String vodId;

    /**
     * 状态
     */
    @Excel(name = "状态")
    private Integer status;

    /**
     * 名称
     */
    @Excel(name = "名称")
    private String name;

    /**
     * meida类型
     */
    @Excel(name = "meida类型")
    private String type;

    /**
     * 格式
     */
    @Excel(name = "格式")
    private String format;

    /**
     * fps
     */
    @Excel(name = "fps")
    private Long fps;

    /**
     * 高
     */
    @Excel(name = "高")
    private Long height;

    /**
     * 大小
     */
    @Excel(name = "大小")
    private Long size;

    private String sizeFormat;

    /**
     * 宽
     */
    @Excel(name = "宽")
    private Long width;

    /**
     * 时长
     */
    @Excel(name = "时长")
    private Long duration;

    /**
     * 是否加密
     */
    @Excel(name = "是否加密")
    private Integer encrypt;

    private String durationFormat;

    /**
     * 创建时间
     */
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdTime;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setVodId(String vodId) {
        this.vodId = vodId;
    }

    public String getVodId() {
        return vodId;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getStatus() {
        return status;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public void setFormat(String format) {
        this.format = format;
    }

    public String getFormat() {
        return format;
    }

    public void setFps(Long fps) {
        this.fps = fps;
    }

    public Long getFps() {
        return fps;
    }

    public void setHeight(Long height) {
        this.height = height;
    }

    public Long getHeight() {
        return height;
    }

    public void setSize(Long size) {
        this.size = size;
    }

    public Long getSize() {
        return size;
    }

    public void setWidth(Long width) {
        this.width = width;
    }

    public Long getWidth() {
        return width;
    }

    public void setDuration(Long duration) {
        this.duration = duration;
    }

    public Long getDuration() {
        return duration;
    }

    public void setEncrypt(Integer encrypt) {
        this.encrypt = encrypt;
    }

    public Integer getEncrypt() {
        return encrypt;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public String getSizeFormat() {
        return SizeUtil.sizeFormat(size);
    }

    public void setSizeFormat(String sizeFormat) {
        this.sizeFormat = sizeFormat;
    }

    public String getDurationFormat() {
        if (duration != null) {
            return DurationUtil.format(duration);
        }
        return DurationUtil.format(0);
    }

    public void setDurationFormat(String durationFormat) {
        this.durationFormat = durationFormat;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("vodId", getVodId())
                .append("status", getStatus())
                .append("name", getName())
                .append("type", getType())
                .append("format", getFormat())
                .append("fps", getFps())
                .append("height", getHeight())
                .append("size", getSize())
                .append("width", getWidth())
                .append("duration", getDuration())
                .append("encrypt", getEncrypt())
                .append("createdTime", getCreatedTime())
                .toString();
    }
}
